<?php
  
    public function shares(){
      $url_1 = I('url_1');
      $url_2 = str_replace("&amp;","&",$url_1 );
      
      $strlen=strlen($url_2);       //全部字符长度
      $tp=strrpos($url_2,"&fenid"); //&fenid之前的字符长度
      $url_2=substr($url_2,-$strlen,$tp);  //从头开始截取到指字符位置。

      Vendor('jssdk');
      $jssdk = new \JSSDK();
      $SignPackage = $jssdk->getSignPackage($url_2);
      
      $SignPackage['timestamp'] ="".$SignPackage['timestamp']."";
      echo json_encode($SignPackage);
    }